export function getTimertype(nowTime, beginTime, endTime) { //返回当前的状态值
    let nowStamp = Date.parse(nowTime.replace(
        new RegExp("-", "gm"),
        "/"
      ));
    let beginStamp = getTimestamp(beginTime.replace(
        new RegExp("-", "gm"),
        "/"
      ));
    let endStamp = getTimestamp(endTime.replace(
        new RegExp("-", "gm"),
        "/"
      ));
    // console.log(nowTime, "当前", beginTime, "开始", endTime, "结束");
    // console.log(Date.parse(nowTime), "当前", this.getTimestamp(beginTime), "开始", this.getTimestamp(endTime), "结束")
    // console.log(nowStamp < beginStamp, "开始时间大于当前时间就是未开始");
    // console.log(nowStamp > beginStamp, nowStamp < endStamp, "当前时间大于开始 并且小于结束时间 正在活动中");
    // console.log(nowStamp > endStamp, "当前时间大于结束时间 活动结束");
    if (nowStamp < beginStamp) {  //活动未开始 预热时间
        return 0
    }
    if (nowStamp >= beginStamp && nowStamp < endStamp) {  //活动进行中
        return 1
    }
    if (nowStamp >= endStamp) {  //活动结束
        return 2
    }
}
export function getTimestamp(time) { //返回时间戳
    return Date.parse(new Date(time))
}